﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Security.Principal;

namespace Directory.Web
{
	/// <summary>
	/// CustomPrincipal 的摘要说明
	/// </summary>
	public sealed class CustomPrincipal : IPrincipal
	{
		private CustomIdentity identity;

		public CustomPrincipal(CustomIdentity identity)
		{
			this.identity = identity;
		}

		#region IPrincipal 成员

		IIdentity IPrincipal.Identity
		{
			get { return identity; }
		}

		bool IPrincipal.IsInRole(string rolename)
		{
			return RoleDataProxy.IsUserInRole(identity.Name, rolename);
		}

		#endregion
	}
}